﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using YSC_Services.BLL.Services.Interfaces;

namespace YSC_Backstage_Web.Controllers
{
    /// <summary>
    /// 鱼种报表(市场)
    /// </summary>
    public class FishSpeciesReportController : Controller
    {

        private IBasisBackstageServices _rep;

        public FishSpeciesReportController(IBasisBackstageServices rep)
        {
            this._rep = rep;
        }


        public IActionResult List()
        {
            return View();
        }

        public IActionResult ListFrom(string fishName, string dateYear, string province, string city, int unitType)
        {
            ViewBag.dateYear = dateYear;
            ViewBag.fishName = fishName;
            ViewBag.province = province;
            ViewBag.city = city;
            ViewBag.unitType = unitType;
            return View();
        }


        /// <summary>
        /// 鱼种年报表
        /// </summary>
        /// <param name="fishType"></param>
        /// <param name="province"></param>
        /// <param name="city"></param>
        /// <param name="dateYear"></param>
        /// <param name="unitType"></param>
        /// <returns></returns>
        public JsonResult FishSpeciesYearReport(string fishType, string province, string city, string dateYear, int unitType)
        {
            var ret = _rep.FishSpeciesYearReport(fishType, province, city, dateYear, 0);
            return Json(ret);
        }

        /// <summary>
        /// 鱼种月报表
        /// </summary>
        /// <param name="fishName"></param>
        /// <param name="province"></param>
        /// <param name="city"></param>
        /// <param name="unitType"></param>
        /// <param name="dateYear"></param>
        /// <returns></returns>
        public JsonResult FishSpeciesMonthReport(string dateYear, string fishName, string province, string city, int unitType)
        {
            var ret = _rep.FishSpeciesMonthReport(dateYear, fishName, province, city, 0);
            return Json(ret);
        }
    }
}